home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / e / mailinglists / amigae.0294feb.archive / 000021_donews!crash!m….msus.edu!platt_Tue, 8 Feb 94 01:43:01 PST.msg < prev    next >
Internet Message Format  |  1994-05-26  |  4KB

  1. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  2.       id <1r09@bkhouse.cts.com>; Tue, 8 Feb 94 01:43:01 PST
  3. Received: from crash by donews.cts.com with uucp
  4.     (Smail3.1.28.1 #18) id m0pTeDS-0001o1C; Mon, 7 Feb 94 14:14 PST
  5. Received: from mhd1.moorhead.msus.edu by crash.cts.com with smtp
  6.     (Smail3.1.28.1 #18) id m0pSjYj-0000MOC; Sat, 5 Feb 94 01:44 PST
  7. Received: by mhd1.moorhead.msus.edu (5.65/DEC-Ultrix/4.3)
  8.     id AA02499; Sat, 5 Feb 1994 03:45:05 -0600
  9. Message-Id: <9402050945.AA02499@mhd1.moorhead.msus.edu>
  10. Date: Sat, 5 Feb 1994 03:45:05 -0600 (CST)
  11. X-Mailer: ELM [version 2.4 PL20]
  12. Content-Type: text
  13. Content-Length: 3412
  14. From: platt@mhd1.moorhead.msus.edu (Vincent Platt)
  15. To: amigae@bkhouse.cts.com (amigae)
  16. Subject: HELP!!! (With AppIcons)
  17.  
  18. I'm working on an AppIcon project, and I've run into what I think may be a
  19. bug in E.  I'm trying to read the appmessage.arglist[].name.  According to
  20. the RKM, the .name part is there, and according to E, it is not.  Ok I can
  21. handle that.  I look up the appmessage structure in 'workbench/workbench'
  22. and it says that appmessage.arglist is a LONG.  So how the heck are you
  23. supposed to read the names of the icons which are dropped on the AppIcon???
  24. BTW - This is an attempted translation of the AppIcons prog on page 360 of
  25. the Libaries RKM.  The code I have so far follows (so far this code can
  26. detect when the AppIcon is double clicked, when objects are dropped on it,
  27. and how many.  Now I just need to get the names of the icons which are
  28. dropped on it!!
  29.  
  30. Thanks in advance for any help.
  31.  
  32. OPT OSVERSION=37
  33.  
  34. /* The following MODULE statements come from EPP.  EPP came up with these
  35. statements given the following PMODULE statements:
  36.  
  37. PMODULE 'eheaders:exec/types'
  38. PMODULE 'eheaders:workbench/workbench'
  39. PMODULE 'eheaders:workbench/startup'
  40. PMODULE 'eheaders:exec/libraries'
  41. */
  42.  
  43.  
  44. MODULE 'exec/types'
  45. MODULE 'exec/nodes'
  46. MODULE 'exec/lists'
  47. MODULE 'exec/tasks'
  48. MODULE 'graphics/gfx'
  49. MODULE 'exec/ports'
  50. MODULE 'exec/semaphores'
  51. MODULE 'utility/hooks'
  52. MODULE 'graphics/clip'
  53. MODULE 'graphics/copper'
  54. MODULE 'graphics/gfxnodes'
  55. MODULE 'graphics/monitor'
  56. MODULE 'hardware/custom'
  57. MODULE 'graphics/view'
  58. MODULE 'graphics/rastport'
  59. MODULE 'graphics/layers'
  60. MODULE 'utility/tagitem'
  61. MODULE 'graphics/text'
  62. MODULE 'exec/io'
  63. MODULE 'devices/serial'
  64. MODULE 'devices/inputevent'
  65. MODULE 'intuition/intuition'
  66. MODULE 'workbench/workbench'
  67. MODULE 'dos/dos'
  68. MODULE 'workbench/startup'
  69. MODULE 'exec/libraries'
  70. MODULE 'icon'
  71. MODULE 'wb'
  72.  
  73. DEF dummy1:LONG
  74. DEF dummy2:PTR TO LONG
  75. DEF str[256]:STRING
  76.  
  77. DEF dropcount
  78. DEF x
  79. DEF dobj:PTR TO diskobject
  80. DEF myport:PTR TO mp
  81. DEF appcon:PTR TO appicon
  82. DEF appmsg:PTR TO appmessage
  83.  
  84. PROC main()
  85.  
  86.     IF (iconbase:=OpenLibrary('icon.library',37))
  87.     IF (workbenchbase:=OpenLibrary('workbench.library',37))
  88.       IF (dobj:=GetDefDiskObject(WBDISK))
  89.         dobj.type=NIL
  90.         IF (myport:=CreateMsgPort())
  91.           IF (appcon:=AddAppIconA(NIL,NIL,'TestAppIcon',myport,NIL,dobj,NIL))
  92.             dropcount:=0
  93.             WriteF('Drop files on the AppIcon.\n')
  94.             WriteF('Example exits after 3 drops.\n')
  95.  
  96.             WHILE dropcount < 3
  97.               WaitPort(myport)
  98.               WHILE appmsg:=GetMsg(myport)
  99.                 IF appmsg.numargs = 0
  100.                   WriteF('User activated the AppIcon.\nA window here would be nice.\n')
  101.                 ELSEIF appmsg.numargs>0
  102.                   WriteF('User dropped \d icons on the AppIcon.\n',appmsg.numargs)
  103.                   FOR x:= 0 TO appmsg.numargs-1
  104.                      dummy1:=appmsg.arglist
  105.                      dummy2:=dummy1[x]
  106.                      StrCopy(str,dummy2,ALL)
  107.                      WriteF('#\d name = \s\n',x+1,str)
  108.                   ENDFOR
  109.                 ENDIF
  110.                 ReplyMsg(appmsg)
  111.               ENDWHILE
  112.               INC dropcount
  113.             ENDWHILE
  114.             RemoveAppIcon(appcon)
  115.             WHILE appmsg:=GetMsg(myport)
  116.               ReplyMsg(appmsg)
  117.             ENDWHILE
  118.             DeleteMsgPort(myport)
  119.             FreeDiskObject(dobj)
  120.             CloseLibrary(workbenchbase)
  121.             CloseLibrary(iconbase)
  122.           ENDIF
  123.         ENDIF
  124.       ENDIF
  125.     ENDIF
  126.   ENDIF
  127. ENDPROC